package com.tieland.xunda.common.sys;

import com.tieland.xunda.common.util.ConfUtil;

import java.util.*;

/**
 * User: qiukx
 * Date: 2008-7-29
 * Company: Freshpower
 * Description:
 */
public class PicoBuffaloServiceConfigurer {

    private static Map services;

    private static ServerContext serverContext;

    /**
     * Get the configed services
     *
     * @return configed services.
     */
    protected static Map getServices() {
        return services;
    }

    static {
        serverContext = ServerContext.getInstance();
        
        services = new HashMap();
        Properties buffaloServices = ConfUtil.load("buffalo-service");
        Set serviceNames = buffaloServices.keySet();
        if (!serviceNames.isEmpty()) {
            for (Iterator it = serviceNames.iterator(); it.hasNext();) {
                String serviceName = (String) it.next();
                String serviceClass = buffaloServices.getProperty(serviceName);
                services.put(serviceName,serviceClass);
            }
        }
    }

    public static void main(String[] arr){
        PicoBuffaloServiceConfigurer.getServices();
    }
}
